//布局框架
import Layout from './view/layout.vue';


//登录页
import SignIn from './components/login/SignIn.vue';
//注册页
import SignUp from './components/login/SignUp.vue';
//默认展示页
import Home from './components/home/Index.vue';
//文章列表页
import ArticleList from './components/article/List.vue';
//添加文章页
import ArticleCreate from './components/article/Create.vue';
//文章详情页
import ArticleItem from './components/article/Item.vue';

//作者页AuthorList
import AuthorList from './components/author/List.vue';
//作者页AuthorList
import AuthorItem from './components/author/Item.vue';

//教程列表页
import TutorialList from './components/tutorial/List.vue';
//添加教程页
import TutorialCreate from './components/tutorial/Create.vue';
//教程详情页
import TutorialItem from './components/tutorial/Item.vue';

//课程列表页
import CourseList from './components/course/List.vue';
//创建课程页
import CourseCreate from './components/course/Create.vue';
//课程详情页
import CourseItem from './components/course/Item.vue';


//案例列表页
import CaseList from './components/case/List.vue';
//添加案例页
import CaseCreate from './components/case/Create.vue';
//案例详情页
import CaseItem from './components/case/Item.vue';

//软件列表页
import SoftwareList from './components/software/List.vue';
//添加软件页
import SoftwareCreate from './components/software/Create.vue';
//软件详情页
import SoftwareItem from './components/software/Item.vue';


//软件列表页
import BookList from './components/book/List.vue';
//添加软件页
import BookCreate from './components/book/Create.vue';
//软件详情页
import BookItem from './components/book/Item.vue';

//注册登录页


//导出router对象
export default {
    routes: [{
            path: '/',
            redirect: '/home'
        },
        {
            path: '/',
            component: Layout,
            children: [{
                path: '/home',
                component: Home,
            }]
        },
        {
            path: '/',
            component: Layout,
            children: [{
                path: '/articles',
                component: ArticleList,
            }, {
                path: '/article/create',
                component: ArticleCreate,
            }, {
                path: '/article/:id(\\d+)',
                component: ArticleItem,
            }]
        },
        {
            path: '/',
            component: Layout,
            children: [{
                path: '/authors',
                component: AuthorList,
            }, {
                path: '/article/:id(\\d+)',
                component: AuthorItem,
            }]
        },
        {
            path: '/',
            component: Layout,
            children: [{
                path: '/tutorials',
                component: TutorialList,
            }, {
                path: '/tutorial/create',
                component: TutorialCreate,
            }, {
                path: '/tutorial/:id(\\d+)',
                component: TutorialItem,
            }]
        },
        {
            path: '/',
            component: Layout,
            children: [{
                path: '/courses',
                component: CourseList,
            }, {
                path: '/course/create',
                component: CourseCreate,
            }, {
                path: '/course/:id(\\d+)',
                component: CourseItem,
            }]
        },
        {
            path: '/',
            component: Layout,
            children: [{
                path: '/cases',
                component: CaseList,
            }, {
                path: '/case/create',
                component: CaseCreate,
            }, {
                path: '/case/:id(\\d+)',
                component: CaseItem,
            }]
        },
        {
            path: '/',
            component: Layout,
            children: [{
                path: '/softwares',
                component: SoftwareList,
            }, {
                path: '/software/create',
                component: SoftwareCreate,
            }, {
                path: '/software/:id(\\d+)',
                component: SoftwareItem,
            }]
        },
        {
            path: '/',
            component: Layout,
            children: [{
                path: '/books',
                component: BookList,
            }, {
                path: '/book/create',
                component: BookCreate,
            }, {
                path: '/book/:id(\\d+)',
                component: BookItem,
            }]
        },
        {
            path: '/signin',
            component: SignIn,

        },
        {
            path: '/signup',
            component: SignUp,
        },
        {
            path: '*',
            //重定向
            redirect: '/home'
        }


    ],
    hashbang: true,
    history: true,
    mode: 'history',
}